<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="{$smarty.const.ADMIN_CSS_PATH}style.css" rel="stylesheet" type="text/css" />
<!--<link href="{$smarty.const.CSS_PATH}bootstrap.min.css" rel="stylesheet" type="text/css" />-->
<link href="{$smarty.const.ADMIN_CSS_PATH}select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$smarty.const.ADMIN_JS_PATH}jquery.min.js"></script>
<style type="text/css">
.scbtn{ background-image:none!important;}
</style>
</head>

<body>

	
    
    <div class="formbody">
    
    
    <div id="usual1" class="usual"> 
    
  	<div id="tab2" class="tabson">
    
    
    <table class="imgtable">
    
    <thead>
    <tr>
    <th>商品名</th>
    <th>订单号</th>
    <th>用户名</th>
    <th style="width: 300px;">图片</th>
    <th style="width: 400px;">内容</th>
    <th>状态</th>
    </tr>
    </thead>
    
    <tbody style="text-align: center;">
    {foreach $comments as $k=>$v}
    <tr>
    <td>({$v.goods_uid}){$v.goods_name}</td>
    <td>{$v.order_uid}</td>
    <td>({$v.user_uid}){$v.user_name}</td>
    <td class="imgtd">{if $v.images!=="/upload/"}<img src="{$v.images}" style="width: 80px;height: 60px;"/>{/if}</td>
    <td>{$v.content}</td>
    {if $v.status==1}
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: lightgreen;" value="{$v.uid}" data-status="{$v.status}" class="scbtn changes">通过</button></td>
    {else if $v.status==0}
    <td><button style="height:35px;margin-bottom: 17px;margin-top: 17px;background-color: orangered;" value="{$v.uid}" data-status="{$v.status}" class="scbtn changes">禁止</button></td>
    {/if}
    </tr>
    {/foreach}
    </tbody>
    </table>
    
    <div class="pagin">
    	<div class="message">共<i class="blue">{$total}</i>条记录，每页显示&nbsp;<i class="blue">10&nbsp;</i>条</div>
        <ul class="paginList">
        	{$pagelist}
        </ul>
    </div>
    
    <!--<div>
    	<iframe name="kuaidi100" src="https://www.kuaidi100.com/frame/index.html" width="960" height="880" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>
	</div>-->
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a class="close"></a></div>
        <!--<form action="{$smarty.const.__CONTROLLER__}/sendgoods" method="post">-->
      <div class="tipinfo">
        <div class="tipright">
        <input type="text" class="dfinput" name="uid" id="uid" value="" placeholder="uid" style="display: none;"/>
        <input type="text" class="dfinput" name="delcom" id="delcom" placeholder="物流公司" style="width: 270px;margin-bottom: 30px;position:relative; left: 10%;"/>
        <input type="text" class="dfinput" name="delnum" id="delnum" placeholder="快递单号" style="width: 270px;position:relative; left: 10%;"/>
        </div>
        </div>
        
        <div class="tipbtn" style="position:relative; left: 5%;">
        <input name="" type="submit"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    	<!--</form>-->
    </div>
    </div>  
       
	</div> 
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$(".changes").click(function(){
		var status=0;
		var data={
			uid:$(this).val(),
			status:($(this).text()=="通过"?1:0),
		};
		
		var t=$(this);
		console.log(t.data('status'));
//		$(this).css("background-color","red");
		$.post("{$smarty.const.__CONTROLLER__}/changecommentsstatus", data, function(ret){
				console.log(ret);
				if(ret.errorcode){
					alert(ret.error);
				}else{
					if(data.status){
//						alert("dd")
						t.text("禁止");
						t.css("background-color","orangered");
					}else{
						t.text("通过");
						t.css("background-color","lightgreen");
					}
				}
			})
	})
	
	</script>
    </div>

</body>
</html>
